from celery import Celery

'''
celery 多任务文件下，celery处理示例

celery.py: 作为配置文件

启动命令： /Users/hemq/Library/Python/3.9/bin/celery -A celery_tasks worker --loglevel=info
'''

backend = "redis://:@localhost:6379/5"
broker = "redis://:@localhost:6379/5"

print(f"backend:{backend}")
cel = Celery("study_celery",
             backend=backend,
             broker=broker,
             # 区别在于：需将任务文件  记录在 include 中
             include=[
                 'celery_tasks.task01',
                 'celery_tasks.task02'
             ]
        )
